#include "Utils.h"

std::string GenerateUuid() {
    uuid_t uuid;
    char uuid_str[37]{};
    // 生成UUID
    uuid_generate(uuid);
    uuid_unparse(uuid, uuid_str);
    return std::string(uuid_str);
}

std::string GenerateUuidWithoutDelimiter() {
    std::stringstream ss;
    uuid_t uuid;
    char uuid_str[37]{};
    // 生成UUID
    uuid_generate(uuid);
    uuid_unparse(uuid, uuid_str);

    for (int i = 0; i < 36; i++) {
        if (uuid_str[i] != '-'  ) {
            ss << uuid_str[i];
        }
    }

    return ss.str();
}